﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            姓名：<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="姓名不能为空！"
                ControlToValidate="TextBox1" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="姓名不能为admin"
                OnServerValidate="CustomValidator1_ServerValidate1"> </asp:CustomValidator>
            <br />
            密码：<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>        
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" 
                runat="server" ErrorMessage="密码不能为空！" ControlToValidate="TextBox2"></asp:RequiredFieldValidator>
            <br />
            确认密码：<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="确认密码不能为空！"
                ControlToValidate="TextBox3" Display="Dynamic"></asp:RequiredFieldValidator>
            <asp:CompareValidator ID="CompareValidator2" runat="server" ErrorMessage="密码不一致！" 
                ControlToCompare="TextBox2" ControlToValidate="TextBox3"></asp:CompareValidator>
            <br />
            年龄：<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox>
            <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="请输入0-100的年龄！"
                MaximumValue="100" MinimumValue="0" Type="Integer" ControlToValidate="TextBox4"></asp:RangeValidator>
            <br />
            出生日期：<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" 
                runat="server" ErrorMessage="日期格式必须为：2002-01-01！" 
                ValidationExpression="\d{4}-\d{2}-\d{2}" ControlToValidate="TextBox5" 
                Display="Dynamic"></asp:RegularExpressionValidator>
            <asp:RangeValidator ID="RangeValidator2" runat="server" 
                ErrorMessage="请输入1900-01-01到系统当前时间" ControlToValidate="TextBox5" 
                MinimumValue="1900-01-01" Type="Date"></asp:RangeValidator>
            <br />
            毕业时间：<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" 
                runat="server" ErrorMessage="日期格式必须为：2002-01-01！" 
                ValidationExpression="\d{4}-\d{2}-\d{2}" ControlToValidate="TextBox6" 
                Display="Dynamic"></asp:RegularExpressionValidator>
            <asp:CompareValidator ID="CompareValidator3" runat="server" 
                ErrorMessage="不能早于出生日期" ControlToCompare="TextBox5" 
                ControlToValidate="TextBox6" Type="Date" Operator="GreaterThan" ></asp:CompareValidator>
            <br />
            电子邮箱：<asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator3" 
                runat="server" ErrorMessage="请输入正确的邮箱格式" ControlToValidate="TextBox7"
                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ></asp:RegularExpressionValidator>
            <br />
            <br />
             头像：<asp:FileUpload ID="ful" runat="server" />
            <br />
            <asp:Literal ID="Literal2" runat="server"></asp:Literal>
            <asp:Image ID="Image1" runat="server" />
            <br />
            <asp:Button ID="Button1" runat="server" Text="提交" OnClick="Button1_Click" />
            <asp:Literal ID="Literal1" runat="server"></asp:Literal>
            <br />
            <br />
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="SingleParagraph" ShowMessageBox="True" OnDataBinding="ValidationSummary1_DataBinding" />
            <br />
        </div>
    </form>
</body>
</html>
